package xiecheng;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author le
 */
public class Test1
{
    public static void main(String[] args)
    {

        Scanner in = new Scanner(System.in);
        // 输入的几种包 以及对应的数量
        int n = in.nextInt();
        List<String> packages = new ArrayList<>();
        // 传入的每个包的价格
        for (int i = 0;i < n;i++){
            packages.add(in.next());
        }
        // 对应包的价格
        int[] price = new int[n];
        for (int i = 0;i < n;i++){
            price[i] = in.nextInt();
        }
        // 需求的权益
        int[] need = new int[n];
        for (int i = 0;i < n;i++){
            need[i] = in.nextInt();
        }

        int[] max = new int[packages.size()];
        for (int i = 0;i < packages.size();i++){
            // 找出数组中的最大的长度的包含的种类越多
            max[i] = packages.get(i).length();
        }

        int index= 0;
        for (int i = 1;i < max.length;i++){
            if (max[index] < max[i]){
                index = i;
            }
        }






        in.close();
    }
}
